Brain Tumor Detection Using Image Processing Techniques
119
4.3.1.2
Mean Filter
Mean filtering is the process of reducing the intensity difference between one
pixel and another pixel in an image. It is commonly used to reduce image noise.
The mean filter replaces each pixel with the average of the pixel values in its
neighborhood (including itself). The neighborhood is determined by placing
the filtered pixel in the center of the sampling window. Let Rxy presents a
subimage window of dimension mxn and the filtered pixel is centered at the
point (x, y). Mean filter can be expressed as Equation 4.2 [13]:
J(x, y) =
1
M ∗N
u,v∈Rx,y
K(u, v)
(4.2)
The filter takes the gray level of the pixel (x, y) in K and replaces it with
the surrounding pixel detail J(x, y).
4.3.1.3
Median Filter
The median filter is a commonly employed non-linear filter to remove noise
from images. It proves particularly efficient in eliminating salt and pepper-
type noise, which refers to random occurrences of black and white pixels. The
median filter examines neighboring pixels to determine the value of each pixel.
The filter moves through the image one pixel at a time. It arranges all pixel
values within the window in ascending order, replacing the current pixel with
the median value. The median filter can be expressed as Equation 4.3 [13]:
J(x, y) = median
(u,v)∈Rxy {K(u, v)}
(4.3)
where Rxy is defined as the set of coordinates of window with center at (x, y).
The filter takes the gray level of the pixel in K and replaces it with the median
value (J(x, y)) of the surrounding gray levels. It performs better compared to
the mean filter [14].
4.3.1.4
Gaussian Filter
Gaussian filter is a non-uniform low pass filter employed for the purpose of
eliminating noise and detail [15]. Its effectiveness lies in its ability to effec-
tively smooth images. Two-dimensional Gaussian functions can be defined as
Equation 4.4:
g(x, y, σ) =
1
2πσ2 e−x2+y2
2σ2
(4.4)
In the equation x and y refer to the plane coordinates, and σ refers to the
standard deviation. The mean of the distribution is assumed to be zero. The
values of the Gaussian mask are determined by the window size and standard
deviation. In this filter, the resulting value obtained by the product of the
kernel matrix and the selected region is replaced with the value of the noisy
pixel.